<div class="row-fluid">
    <div class="span2">
        <div>
            <p class="nav-header">Actions</p>
            <ul class="nav nav-tabs nav-stacked">   
                <li>
                    <form action="<?php echo $this->Html->url('delete_opinion/' . $opinion['Opinion']['id'] . '/' . $broker['Broker']['id']); ?>" name="post_delete" id="post_delete" style="display:none;" method="post">
                        <input type="hidden" name="_method" value="POST">
                    </form>
                    <a href="#" onclick="if (confirm('Are you sure you want to delete #<?php echo $opinion['Opinion']['id']; ?>?')) {
                                document.post_delete.submit();
                            }
                            event.returnValue = false;
                            return false;">Delete</a>
                </li>
                <li><a href="<?php echo $this->Html->url('opinions/' . $broker['Broker']['id']); ?>"><?php echo $broker['Broker']['fullname'] ?>'s Opinions</a></li>
            </ul>
        </div>
    </div>
    <div class="span10">
        <form action="" class="well" id="BrokerAddForm" method="post" accept-charset="utf-8">
            <div style="display:none;">
                <input type="hidden" name="_method" value="PUT">
            </div>        
            <fieldset>
                <legend>Add Opinion</legend>             

                <div class="control-group required">
                    <label for="Stock">Stock (*)</label>
                    <select name="stock" help="" id="Stock" required="required">
                        <?php
                        foreach ($stocks as $stock) {
                            if ($opinion['Opinion']['stock'] == $stock['Stock']['id'])
                                echo '<option value="' . $stock['Stock']['id'] . '" selected="selected">' . $stock['Stock']['name'] . '</option>';
                            else
                                echo '<option value="' . $stock['Stock']['id'] . '">' . $stock['Stock']['name'] . '</option>';
                        }
                        ?>
                    </select>                    
                </div>

                <div class="control-group required">
                    <label for="Date">Date (*)</label>
                    <input name="date" help="" class="datepicker" type="text" value="<?php echo date('Y-n-d', strtotime($opinion['Opinion']['date'])) ?>" id="Date" required="required">
                </div>

                <div class="control-group">
                    <label for="opinion">Opinion</label>
                    <select name="opinion" help="" id="opinion">
                        <option value="0" <?php if ($opinion['Opinion']['opinion'] == 0) echo 'selected="selected"'; ?>>Up</option>
                        <option value="1" <?php if ($opinion['Opinion']['opinion'] == 1) echo 'selected="selected"'; ?>>Unchange</option>
                        <option value="2" <?php if ($opinion['Opinion']['opinion'] == 2) echo 'selected="selected"'; ?>>Down</option>
                    </select>
                </div>


                <?php
                if ($opinion['Opinion']['result']):
                    ?>
                    <div class="control-group">
                        <label for="result">Result</label>
                        <select name="result" help="" id="result">
                            <option value="1" <?php if ($opinion['Opinion']['result'] == 1) echo 'selected="selected"'; ?>>Right</option>
                            <option value="2" <?php if ($opinion['Opinion']['result'] == 2) echo 'selected="selected"'; ?>>Wrong</option>
                        </select>
                    </div>
                    <?php
                endif;
                ?>
            </fieldset>        
            <div class="submit">
                <input class="btn btn-primary" type="submit" value="Save">
            </div>
        </form>    
    </div>
</div>